﻿using System.Linq;
using System.Collections.Generic;
using QMSDAL;
namespace QuaManSys
{
    public class RegistStatus
    {
        public static List<InnerQualityInfo> InnerRegistInfo(CurUser user)
        {
            using (var context = new QuaManSysEntities())
            {
                if (Permission.JudgePermission(user, "1A", "A"))
                {
                    var infoPro =
                    from c in context.InnerQualityInfo
                    where c.processingStatus=="登记" && c.registrantName == user.employeeId
                    select c;
                    List<InnerQualityInfo> list = infoPro.ToList();
                    return list;
                }
                return null;
            }
        }

        public static List<OuterQualityInfo> OuterRegistInfo(CurUser user)
        {
            using (var context = new QuaManSysEntities())
            {
                if (Permission.JudgePermission(user, "1A", "A"))
                {
                    var infoPro =
                    from c in context.OuterQualityInfo
                    where c.processingStatus == "登记" && c.registerName == user.employeeId
                    select c;
                    List<OuterQualityInfo> list = infoPro.ToList();
                    return list;
                }
                return null;
            }
        }

        //public static List<CusSatSur> CusRegistInfo(CurUser user)
        //{
        //    using (var context = new QuaManSysEntities())
        //    {
        //        if (Permission.JudgePermission(user, "1A", "A"))
        //        {
        //            var infoPro =
        //            from c in context.CusSatSur
        //            where c.processStatus == "登记"
        //            select c;
        //            List<CusSatSur> list = infoPro.ToList();
        //            return list;
        //        }
        //        return null;
        //    }
        //}
    }
}